package com.util;

import java.sql.DriverManager;
import java.sql.SQLException;

import com.mysql.jdbc.Connection;

public class DateBaseUtil {
	public static Connection getconnection() throws SQLException{
		Connection conn=null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			String url="jdbd:mysql://localhost:3306/examdb1?useUnicode=true&characterEncoding=UTF-8";
			conn=(Connection) DriverManager.getConnection(url, "root","root123");
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return conn;
		
	}
	public static void closeConnection(Connection conn) throws SQLException{
		conn.close();
	}

}
